﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GatherWebLib.Model
{
   public class cWebLink_m
    {
       #region 构造 析构
        public cWebLink_m()
        {
            m_IsGathered = (int)cGlobalParas.UrlGatherResult.UnGather;
            m_NavigRules = new List<cNavigRule_m>();
        }

       

        #endregion

        #region 属性
        private int m_id;
        public int ID
        {
            get { return m_id; }
            set { m_id = value; }
        }
        private int _taskid;
        /// <summary>
        /// 任务ID
        /// </summary>
        public int TaskID
        {
            set { _taskid = value; }
            get { return _taskid; }
        }
        private string m_Weblink;
       /// <summary>
       /// url地址
       /// </summary>
        public string Weblink
        {
            get { return m_Weblink; }
            set { m_Weblink = value; }
        }

        private bool _ischange;

        private string _urlcolname;
        private GatherWebLib.cGlobalParas.WebCode _webcode;
        private string _startpos;
        private string _endpos;
        /// <summary>
        /// url地址是否是变化的
        /// </summary>
        public bool IsChange
        {
            set { _ischange = value; }
            get { return _ischange; }
        }
        /// <summary>
        /// URl对应的字段
        /// </summary>
        public string UrlColName
        {
            set { _urlcolname = value; }
            get { return _urlcolname; }
        }
        /// <summary>
        /// 页面内容编码 0 默认 ,1 gb2312,2 utf8, 3 gbk
        /// </summary>
        public GatherWebLib.cGlobalParas.WebCode WebCode
        {
            set { _webcode = value; }
            get { return _webcode; }
        }
        /// <summary>
        /// 页面抓取数据开始位置
        /// </summary>
        public string StartPos
        {
            set { _startpos = value; }
            get { return _startpos; }
        }
        /// <summary>
        /// 页面抓取数据结束位置
        /// </summary>
        public string EndPos
        {
            set { _endpos = value; }
            get { return _endpos; }
        }

        //是否为导航页，如果是导航页则需要根据导航规则来进行内容也的提取
        private bool m_IsNavigation;
        public bool IsNavigation
        {
            get { return m_IsNavigation; }
            set { m_IsNavigation = value; }
        }

        

        //多层导航规则，是一个集合类
        private List<cNavigRule_m> m_NavigRules;
        public List<cNavigRule_m> NavigRules
        {
            get { return m_NavigRules; }
            set { m_NavigRules = value; }
        }

        //是否提取下一页标识
        private bool m_IsNextPage;
        public bool IsNextpage
        {
            get { return m_IsNextPage; }
            set { m_IsNextPage = value; }
        }

        //下一页标识
        private string m_NextPageRule;
        public string NextPageRule
        {
            get { return m_NextPageRule; }
            set { m_NextPageRule = value; }
        }

        //标识当前网页地址是否已经采集,默认cGlobalParas.UrlGatherResult.UnGather
        private int m_IsGathered;
        public int IsGathered
        {
            get { return m_IsGathered; }
            set { m_IsGathered = value; }
        }

        private string m_CurrentRunning;
        public string CurrentRunning
        {
            get { return m_CurrentRunning; }
            set { m_CurrentRunning = value; }
        }
        private bool m_IsUrlEncode;
        public bool IsUrlEncode
        {
            get { return m_IsUrlEncode; }
            set { m_IsUrlEncode = value; }
        }

        private GatherWebLib.cGlobalParas.WebCode m_UrlEncode;
        public GatherWebLib.cGlobalParas.WebCode UrlEncode
        {
            get { return m_UrlEncode; }
            set { m_UrlEncode = value; }
        }
        #endregion
    }
}
